Review of frameworks for creating a server application on nodejs

What is Node.js?

Node or Node.js is a server implementation of the JavaScript programming language, based on the V8 engine. It is designed to create scalable distributed network applications, such as a web server. Node.js for purposes of use is similar to Twisted frameworks in Python and EventMachine in Ruby. Unlike most JavaScript programs, this framework is executed not on the client’s browser, but on the server side.

What is framework?

framework is a set of tools, libraries, good code that will help turn routine tasks into modules that can be used repeatedly. The task of the framework is to allow the designer or developer to focus on tasks that are unique within this project. In other words, do not reinvent the wheel time after time.

Now the frameworks themselves

Consider such auxiliary tools for server development on JS, like:

  • Express
  • Meteor
  • Mean
  • Koa
  • Hapi
  • Sails
  • Socket

Express

Express is a minimalistic and flexible web framework for Node.js applications, providing an extensive set of functions for mobile and web applications.

Express, as is well known, develops its own way, unlike other frameworks that rely heavily on Rails, but also borrowed a lot from another Ruby framework called Sinatra. The concept is simple: the framework provides enough opportunities for starting and running “on the fly”, without requiring much time for preparation.

This is the framework that makes the creation of most sites very simple. The first thing you need to do is install it.
$ npm install express --save
Together with the site node, you will have the npm command. This tool gives you access to a huge number of modules created by the community, and Express is just one of them.

Pluses of this framework:

1) Low entry threshold, Express is practically the standard Node.js-application.
2) Complete customization.

Minuses:

1) All resources must be created manually and, as a result, there will be a lot of repeated code or worse - own library.
2) Each resource requires testing or a simple check for the 500th error.
3) Refactoring will become painful, as it will be necessary to rule everything and everywhere.
4) There is no standard approach, you need to look for your own.
->Example of development on Express
->Official site

Meteor

Meteor is an MVC (Model-View-Controller) open source framework, with which you can create real-time Web applications. One of the most important features of the platform is that it allows you to use the same code both on the server side and on the client side. Between the server and the client, as a rule, data is transferred, but not HTML-code. The framework supports OS X, Windows and Linux. Its reactive programming model allows you to create applications using less JavaScript code.

Pluses of this framework:

1) The server and client code is written in one language
2) Conveniently debug the code directly from the browser
3) You can quickly demonstrate the status of the project to the client using meteor deploy

Minuses:

1) Not suitable for large projects
2) Not at all suitable for mobile devices due to the large amount of JavaScript
3) In the code some trivial problems have to be solved with the help of cumbersome constructions
->Example of development on Meteor
->Official site

Mean

MEAN (an abbreviation of MongoDB, Express.js, Angular.js, Node.js) is a set of server software that is used for web development. At the client, server, and database level, the entire MEAN stack is written in JavaScript. Displacement of the base platform from the OS (Linux) to the runtime JavaScript (Node.js) carries with it independence from the OS: Node.js runs on Windows and OS X as well as on Linux.

The main shift MEAN is the transition from the traditional generation of server-side pages to targeting single-page applications (SPAs) on the client side.
->Example of development on Mean
->Official site

Koa

The development team of the Express.js framework created another framework called Koa.js - the next generation futuristic framework for Node.js, which promises to be more concise and vivid in comparison with Express.js. Koa.js is focused on creating web applications and APIs, its main advantage is generators, which are an excellent way to avoid callbacks, and help developers in correcting errors.
->Example of development on koajs
->Official site

Hapi

Less well-known framework, which is developed by the team of Walmart Labs. Unlike Express, it has a slightly different approach, which provides more functionality right out of the box. The pluses include full control over the reception of requests and a detailed reference with the generation of documentation.

Pluses of this framework:

1) Full control over the reception of requests.
2) Detailed reference with the generation of documentation.

Minuses:

1) hapi, as well as Express, gives excellent opportunities, but how to use them, you must understand yourself.
->Official site

Sails

Sails.js is an MVC (Model-View-Controller) framework that allows you to easily and quickly create Node.js applications. Sails.js is best suited for creating real-time applications. It is based on the MVC pattern, like Ruby on Rails, but also supports the requirements of modern applications: software interfaces with a scalable, service-oriented architecture. This framework is particularly suitable for the development of chat rooms, real-time toolbars and multiplayer games.
->Offcial site

Socket

Socket. IO - JavaScript library for web applications and real-time data exchange. It consists of two parts: client, which runs in the browser and server for node.js. Both components have a similar API.

Pluses:

1) Powerful and easy to use
2) Used by many large companies
->Offisial site
->Using the Socket library
->One more example

Conclusion

Actually, on this we examined several frameworks for server development on JS. For a more detailed dive, you need to use links to official sites.